package com.itc.dispatch.controller;

import com.itc.common.core.domain.R;
import com.itc.common.core.validate.Add;
import com.itc.dispatch.domain.TagEntering;
import com.itc.dispatch.service.TagEnteringService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/tag/entering")
@Api(value = "tagEntering", tags = "标签录入管理模块")
public class TagEnteringController {
    @Autowired
    private TagEnteringService tagEnteringService;

    /**
     * 获取全部标签数据
     */
    @PostMapping("/getList")
    @ApiOperation(value = "获取全部标签数据")
    public R<List<String>> getList(@RequestBody TagEntering tagEntering){
       return tagEnteringService.getList(tagEntering);
    }

    /**
     * 标签类型录入
     */
    @PostMapping("/confirm")
    @ApiOperation(value = "标签类型录入确定")
    public R update(@RequestBody @Validated(Add.class) TagEntering tagEntering){
        return tagEnteringService.confirm(tagEntering);
    }



}
